package demo2;

public class Test2 {
    public static void main(String[] args) {
        //forName （）获取Class对象
        Class<?> c1 ;
        try {
           c1 =  Class.forName("demo2.Student");
        } catch (ClassNotFoundException e) {
            throw new RuntimeException(e);
        }
        Class<?> c2 ;
        c2  = Student.class;

        Student student = new Student();
        Class<?> c3 ;
        c3 = student.getClass();

        System.out.println(c1 == c2);
        System.out.println(c1.equals(c3));
        System.out.println(c2.equals(c3));
    }
}
